package com.clementheliou.cheliou.dal.model.base.enumeration;

/**
 * Enumeration that contains the sort orders.
 * 
 * @author Clément HELIOU (clement.heliou@gmail.com)
 * @since 1.0
 */
public enum SortOrder {

	/**
	 * The ascending order.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @since 1.0
	 */
	ASCENDING("enum_sort_order_in_ascending_order", "ASC"),

	/**
	 * The descending order.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @since 1.0
	 */
	DESCENDING("enum_sort_order_in_descending_order", "DESC");

	/**
	 * Key to be used for the sort order's label translation.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @since 1.0
	 */
	private String labelKey;

	/**
	 * The HQL clause to be used in queries.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @since 1.0
	 */
	private String hqlClause;

	/**
	 * Builder from the fields.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @param labelKey the label key to be used.
	 * @param hqlClause the HQL clause to be used.
	 * @since 1.0
	 */
	private SortOrder(String labelKey, String hqlClause) {
		this.labelKey = labelKey;
		this.hqlClause = hqlClause;
	}

	/*
	 * Getters & setters.
	 */

	public String getLabelKey() {
		return labelKey;
	}

	public String getHqlClause() {
		return hqlClause;
	}

}
